package com.elangzhi.ssm.model;

import com.elangzhi.ssm.model.base.BaseModel;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Advice extends BaseModel {

    private Long id;

    private String title;

    private String content;

    private Date setTime;

    private Long userId;

    /**
     * 类型
     * 1，验证码发送
     *2,短信验证码
     * 3 店铺公告
     */
    private Integer type;

    private Integer readed;

    public Advice(Long id, String title, String content, Date setTime, Long userId, Integer type, Integer readed) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.setTime = setTime;
        this.userId = userId;
        this.type = type;
        this.readed = readed;
    }

    public Advice() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSetTime(String pattern) {
        if(setTime == null){ return ""; }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(setTime);
    }

    public Date getSetTime() {
        return setTime;
    }

    public void setSetTime(Date setTime) {
        this.setTime = setTime;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getReaded() {
        return readed;
    }

    public void setReaded(Integer readed) {
        this.readed = readed;
    }
}